# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=junkie
pkgver=28.83a6faf
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-sniffer' 'blackarch-networking')
pkgdesc='A modular packet sniffer and analyzer.'
arch=('x86_64' 'aarch64')
url='https://github.com/securactive/junkie'
license=('GPL3')
depends=('rlwrap' 'doxygen' 'openssl-1.0' 'libpcap' 'guile' 'p0f')
makedepends=('git')
#source=("git+https://github.com/securactive/$pkgname.git")
source=("git+https://github.com/krissg/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  export LIBS="-ldl"

  sh autogen.sh

  ./configure --prefix=/usr --sbindir=/usr/bin

  make
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/etc"

  make install DESTDIR="$pkgdir"

  mv "$pkgdir/usr/etc/$pkgname" "$pkgdir/etc/$pkgname"
}

